﻿@model IEnumerable<AuditWeb.Models.ProfileModel>

@{
    ViewBag.Title = @AuditResources.UI.PageTitle;
}

<h2>@AuditResources.Account.ObjectName<text>管理</text></h2>
@Html.ActionLink(AuditResources.UI.Create, "Register", "Account", null, new { Class = "button" })
<div class="padding_panel">
@using(Html.BeginForm("UserList"))
{
    <text>角色:</text> @Html.DropDownList("rolename", AuditResources.UI.All) <text>&nbsp;</text>
     <input type="submit" value="@AuditResources.UI.Search" /> 
}
</div>
<table>
<tr>
<th>@AuditResources.Account.Username</th>
<th>@AuditResources.Account.RoleName</th>
<th>@AuditResources.Account.County</th>
<th>@AuditResources.Account.Subject</th>
<th>@AuditResources.Account.RealName</th>
<th>@AuditResources.Account.Telephone</th>
<th></th>
</tr>
@foreach (AuditWeb.Models.ProfileModel user in Model)
{
<tr>
<td>@user.Username</td>
<td>@foreach (var role in user.Roles)
    {
        @role<span> - </span>
    }</td>
<td>@user.CountyName</td>
<td>@user.SubjectName</td>
<td>@user.RealName</td>
<td>@user.Telephone</td>
<td>
 @Html.ActionLink(AuditResources.UI.Edit, "EditProfile","Account", new { action = "EditProfile", username = user.Username}, new { Class = "button" }) |
@Html.ActionLink(AuditResources.UI.Delete, "Delete","Account", new { action = "Delete", username = user.Username }, new { Class = "button" })|
@Html.ActionLink(AuditResources.Account.ResetPassword, "ResetPassword", "Account", new { action = "ResetPassword", username = user.Username }, new { @class = "button", onclick="return confirm('确定要重设密码吗？')" }) </td>
</tr>
}
</table>